Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The reassignment test checks only replacement-cache sizes, so it can still pass when outgoing DSA/DH buffers are not wiped or freed, leaving the intended regression undetected.
1 open issue
What changed in this PR
This PR addresses F-8331 by clearing previous DER key caches during reassignment in wolfSSL’s OpenSSL compatibility layer.
Changes:
- Wipe and free cached DER data and reset cache metadata before DSA, DH, and RSA reassignment.
- Clear temporary DER buffers before release on affected paths.
- Add and register a regression test covering repeated and cross-key-type reassignment.
| File | Description |
|---|---|
wolfcrypt/src/evp.c |
Adds DER cache cleanup and temporary-buffer wiping. |
tests/api/test_evp_pkey.h |
Declares and registers the reassignment test. |
tests/api/test_evp_pkey.c |
Adds reassignment checks for DSA, RSA, and DH caches. |
Review effort: Balanced
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11965
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_evp_pkey.h
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11965
Scan targets checked: wolfssl-bugs
Unchanged since last review (not re-run): wolfcrypt-src, wolfcrypt-bugs
Not reviewed (no scan target covers them): tests/api/test_evp_pkey.h
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11965
Fenrir already completed a review of this PR at commit 3d5a7b4c2aac (run 3852); its findings are the review threads on the PR. Push a new commit to request another review.

Description
Wipe and free previous EVP_PKEY DER cache on reassignment.
Fixes F-8331
Testing
Added test_wolfSSL_EVP_PKEY_reassign_der_cache.
Checklist